import { createStore, applyMiddleware } from 'redux'
import reducer from './reducer'
import createSagaMiddleware from 'redux-saga'
import watchSaga from './saga'
// create the saga middleware
const sagaMiddleware = createSagaMiddleware()

// mount it on the Store
const store = createStore(reducer, applyMiddleware(sagaMiddleware))

// mySaga 自己写

// then run the saga
sagaMiddleware.run(watchSaga)

export default store